package cn.edu.hbsi.dao;

import cn.edu.hbsi.domain.User;
import org.apache.ibatis.annotations.*;

public interface UserDao
{
    //根据用户id查询用户及其订单
    @Results({
            @Result(id = true,property = "uId",column = "id"),
            @Result(property = "uName",column = "username"),
            @Result(property = "uAddress",column = "address"),
            @Result(property = "orders",column = "id",many = @Many(select = "cn.edu.hbsi.dao.OrdersDao.selectOrdersByUId"))
    })
    @Select("select * from tb_user where id=#{uId}")
    public User selectUserByUId(@Param("uId") Integer uId);
}
